﻿using UnityEngine;
using System.Collections;

public class moveTiggle_t : MonoBehaviour {
    public Transform currentBg;
    public bg_t bg1;
    public bg_t bg2;

    private void OnTriggerEnter(Collider other) {
        if(other.tag == "Player"){
            Transform LastBg = GameManger_t.instance.LastBg;
            currentBg.position = new Vector3(LastBg.position.x + 15, currentBg.position.y, currentBg.position.z);
            GameManger_t.instance.LastBg = currentBg;
            bg1.RondomWithY();
            bg2.RondomWithY();
            
        }
    }
}
